package zhh.tangbao.commodity.vo;

import lombok.Data;
import zhh.tangbao.commodity.entity.CommodityEntity;
import zhh.tangbao.user.vo.UserAccountAndNameVo;

/**
 * <p>
 *     描述
 * </p>
 * @author 粥灰灰
 * <p>2023/3/5</p>
 */

@Data
public class CommodityEntityVo extends CommodityEntity {

    private UserAccountAndNameVo createUser;

    private UserAccountAndNameVo updateUser;

    public CommodityEntityVo(CommodityEntity entity) {
        super(entity.getId(), entity.getCommodityName(), entity.getCommodityIntroduction(), entity.getCommodityImg(), entity.getCommodityPrice(), entity.getCommodityPriceIncrease(), entity.getSellStatus());
        this.setBaseCreateInfo(entity.getRecordUserId(), entity.getRecordTime(), entity.getDataStatus());
        this.setUpdateInfo(entity.getUpdateUserId(), entity.getUpdateTime());
    }

    public CommodityEntityVo(CommodityEntity entity, UserAccountAndNameVo createUser, UserAccountAndNameVo updateUser) {
        this(entity);
        this.createUser = createUser;
        this.updateUser = updateUser;
    }
}
